#include "CourseOutline.h"

CourseOutline::CourseOutline()
{
}

CourseOutline::CourseOutline(QString newTitle, QVector<OutlineSection> list, QString status)
{
    this->outlineSectionList=list;
    this->title=newTitle;
    this->status = "new";
}

void CourseOutline::setTitle(QString newTitle)
{
    this->title=newTitle;
}

void CourseOutline::addOutlineSection(OutlineSection section)
{
    this->outlineSectionList.append(section);
}

void CourseOutline::removeOutlineSection(OutlineSection section)
{

}

QString CourseOutline::getTitle() const
{
    return title;
}

QString CourseOutline::getStatus() const
{
    return status;
}

void CourseOutline::setStatus(QString newStatus)
{
    this->status = newStatus;
}

QVector<OutlineSection> CourseOutline::getOutlineSectionList() const
{
    return outlineSectionList;
}

QVector<OutlineSection> CourseOutline::getOutlineSectionList2()
{
    return outlineSectionList;
}

CourseOutline &CourseOutline::operator =(const CourseOutline &source)
{
    title = source.title;
    outlineSectionList = source.outlineSectionList;
    status = source.status;
    return *this;
}

QDataStream &operator<<(QDataStream &out, const CourseOutline &data)
{
   out << data.getTitle() << data.getOutlineSectionList() << data.getStatus();
   return out;
}

QDataStream &operator>>(QDataStream &in, CourseOutline &data)
{
    QString title;
    QVector<OutlineSection> outlineSectionList;
    QString status;
    in >> title >> outlineSectionList;
    data = CourseOutline(title, outlineSectionList, status);

    return in;
}

